import requests from '../common/request'

export function getMenus(data) {
  return requests.post({
    url: '/wcanyin/restapi/getMenu',
    data: data
  })
}

export function getShops(data) {
  return requests.post({
    url: '/wcanyin/restapi/getShops',
    data: data
  })
}

export function getUserPhone(data) {
  return requests.post({
    url: '/wx/user/base/phone',
    data: data
  })
}

export function createOrder(data) {
  return requests.post({
    url: '/wcanyin/restapi/createOrder',
    data: data
  })
}

export function continuePayOrder(data) {
  return requests.post({
    url: '/wcanyin/restapi/continuePayOrder',
    data: data
  })
}

export function queryOrder(data) {
  return requests.post({
    url: '/wcanyin/restapi/queryOrder',
    data: data
  })
}

export function cancelOrder(data) {
  return requests.post({
    url: '/wcanyin/restapi/cancelOrder',
    data: data
  })
}

export function querySingleItem(data) {
  return requests.post({
    url: '/wcanyin/restapi/querySignleItem',
    params: data
  })
}
// 获取订单列表
export function getOrderList(data) {
  return requests.post( {
    url: '/wcanyin/restapi/queryOrders',
    data: data
  })
}
// 获取桌码
export function queryTables(data) {
  return requests.get({
    url: '/wcanyin/restapi/queryTables',
    params: data
  })
}
// 获取分享二维码
export function getShareCode(query) {
  return requests.get({
    url: `/wcanyin/anon/share?shopId=${query.shopId}&itemId=${query.itemId}`,
  })
}
// 获取商品详情
export function getProDetail(query) {
  return requests.get({
    url: `/wcanyin/anon/shareDetail?shopId=${query.shopId}&itemId=${query.itemId}&classifyId=${query.classifyId}`,
  })
}
// 获取门店详情
export function getShopDetail(query) {
  return requests.post({
    url: `/wcanyin/anon/getShop`,
    data:query
  })
}


// 获取门店状态详情
export function getShopStatus(query) {
  return requests.post({
    url: `/wcanyin/anon/getShopStatus`,
    data:query
  })
}

// 获取距离门店最近的地址
export function nearByAddress(query) {
  return requests.get({
    url: `/mall/mobile/address/nearby_address?longitude=${query.longitude}&latitude=${query.latitude}`,
  })
}


